<template>
  <li>
    <div class="list-item">
      <p><span>{{comment.name}}</span>说：</p>
      <p>{{comment.content}}</p>
      <a href="javascript:;" @click="deleteItem">删除</a>
    </div>
  </li>
</template>

<script>
export default {
  props: {
    comment: Object,
    deleteComment: Function,
    index: Number
  },
  data () {
    return {
    }
  },
  methods: {
    deleteItem() {
      const {comment, index, deleteComment} = this
      if(window.confirm(`确定删除${comment.name}的评论吗`)){
        deleteComment(index)
      }
    }
  }
}
</script>

<style lang="scss">
  
</style>